import { defineConfig } from 'vite'
import { resolve } from 'node:path'

export default defineConfig({
  // root: resolve(__dirname, './src/html'),
  mode: "development", // development, production
  server: {
    open: true,
    port: 25040,
    proxy: {
      '/bw': {
        target: 'http://121.89.213.194:3001',
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/bw/, ''),
      }
    }
  },
  build: {
    sourcemap: true,
    rollupOptions: {
      input: {
        // index: resolve(__dirname, 'index.html'),
        detail: resolve(__dirname, 'detail.html'),
        // search: resolve(__dirname, 'search.html'),
        index: resolve(__dirname, 'index.html')
      }
    }
  }
})
